<div>
	<yu-panel title="事件信息" v-loading="loading">
		<yu-tabs v-model="eventHisLog">
			<yu-tab-pane label="所有事件列表" name="basicEventLog">
				<yu-row :gutter="24">
					<yu-col :span="5">
						<yu-xtree ref="refTree" :height="height" @node-click="nodeClickFn" :data-url="treeDataUrl" data-id="currentNodeId" data-label="currentNodeName"
						 data-pid="parentId" :data-async="async" :data-params="param" data-root="0000" style="margin:10px 10px 0 0;" icon="iconPath">
						</yu-xtree>
					</yu-col>
					<yu-col :span="19">

						<yu-xform related-table-name="refTable" form-type="search" v-model="searchFormdata">
							<yu-xform-group :column="4">
								<yu-xform-item label="系统名称" placeholder="系统名称" ctype="input" name="appName" :disabled="appNameDisabled"></yu-xform-item>
								<yu-xform-item label="事件代码" placeholder="事件代码" ctype="input" name="eventCode"></yu-xform-item>
								<yu-xform-item label="事件名称" placeholder="事件名称" ctype="input" name="eventName"></yu-xform-item>
								<yu-xform-item label="周期时点" :title="searchFormdata.cycleTime" placeholder="周期时点" ctype="datepicker" name="cycleTime" value-format="yyyyMMdd"
								 format="yyyyMMdd"></yu-xform-item>
							</yu-xform-group>
						</yu-xform>
						<!--	<yu-xform related-table-name="refTable" form-type="search" v-model="searchFormdata2">
					<yu-xform-group :column="4">
						<yu-xform-item label="系统代码" placeholder="系统代码" ctype="input" name="appCode" ></yu-xform-item>
						<yu-xform-item label="分组代码" placeholder="分组代码" ctype="input" name="groupCode"></yu-xform-item>
						<yu-xform-item label="关系" placeholder="关系" ctype="input" name="relation"></yu-xform-item>
					</yu-xform-group>
				</yu-xform>-->

						<!-- 按钮 -->
						<yu-toolBar>
							<yu-button @click="markEventList('event')" v-if="updateFnShow1">批量标记事件</yu-button>
							<yu-button @click="cleanEventList('event')" v-if="updateFnShow1">批量清除事件</yu-button>
						</yu-toolBar>
						<div ref="tableBox" style="overflow: auto;">
							<yu-xtable ref="refTable" :height="tbHeight" row-number :data-url="dataUrl" :pageable="true" @selection-change="selectEvent"
							 selection-type="checkbox" @row-click="cellClick">
								<yu-xtable-column label="系统名称" prop="appName" :show-overflow-tooltip="true"></yu-xtable-column>
								<yu-xtable-column label="事件代码" prop="eventCode" :show-overflow-tooltip="true"></yu-xtable-column>
								<yu-xtable-column label="事件名称" prop="eventName" :show-overflow-tooltip="true">
									<template slot-scope="scope">
										<div v-if="scope.row.eventType=='G'">{{ scope.row.eventName }}</div>
										<a v-if="scope.row.eventType=='F'" style="text-decoration:underline;color:#636CE4 " href="javascipt:void(0);" @click="viewDataFn(scope.row)">{{
											scope.row.eventName }}</a>
									</template>
								</yu-xtable-column>
								<yu-xtable-column label="事件路径" prop="folderPath" :show-overflow-tooltip="true"></yu-xtable-column>
								<yu-xtable-column label="周期时点" prop="cycleTime" width="90px"></yu-xtable-column>
								<yu-xtable-column label="事件类型" prop="eventType" :options="eventTypeOption"></yu-xtable-column>
								<yu-xtable-column label="事件记录时间" width="150px" prop="recordTimeStr" :show-overflow-tooltip="true"></yu-xtable-column>
								<yu-xtable-column label="状态" prop="recordTime" :formatter="stateFormatter"></yu-xtable-column>
								<yu-xtable-column label="操作" width="140px">
									<template slot-scope="scope">
										<yu-button @click="recordEvent(scope.row,'event')" type="text" size="small" v-if="scope.row.eventType=='G' && scope.row.recordTime==null">记录事件</yu-button>
										<yu-button @click="deleteEvent(scope.row,'event')" type="text" size="small" v-if="scope.row.recordTime!=null" style="margin-left: 0px">清除事件</yu-button>
									</template>
								</yu-xtable-column>
							</yu-xtable>
						</div>
					</yu-col>
				</yu-row>
			</yu-tab-pane>
			<yu-tab-pane label="作业流事件列表" name="flowEventLog">
				<yu-xform related-table-name="refFlowEventTable" form-type="search" v-model="searchFlowFormdata" label-width="120px">
					<yu-xform-group :column="3">
						<yu-xform-item label="系统名称" placeholder="系统名称" filterable ctype="select" name="appCode" @change="changeApp" :options="appOption"
						 :rules="requiredRule"></yu-xform-item>
						<yu-xform-item label="所属作业流" placeholder="所属作业流" filterable ctype="select" name="groupCode" :options="groupOption" :rules="requiredRule"></yu-xform-item>
						<yu-xform-item label="依赖关系" placeholder="依赖关系" ctype="select" name="relation" :options="relOption" :rules="requiredRule"></yu-xform-item>
						<yu-xform-item label="周期时点" placeholder="周期时点" ctype="datepicker" name="cycleTime" value-format="yyyyMMdd" format="yyyyMMdd"></yu-xform-item>
					</yu-xform-group>
				</yu-xform>

				<yu-toolBar>
					<yu-button @click="markEventList('flow')" v-if="updateFnShow1">批量标记事件</yu-button>
					<yu-button @click="cleanEventList('flow')" v-if="updateFnShow1">批量清除事件</yu-button>
				</yu-toolBar>

				<yu-xtable ref="refFlowEventTable" :height="tbHeight1" row-number :data-url="flowDataUrl" :pageable="true" @selection-change="selectEvent"
				 selection-type="checkbox" @row-click="cellClick">
					<yu-xtable-column label="系统名称" prop="appName" :show-overflow-tooltip="true"></yu-xtable-column>
					<yu-xtable-column label="事件代码" prop="eventCode" :show-overflow-tooltip="true"></yu-xtable-column>
					<yu-xtable-column label="事件名称" prop="eventName" :show-overflow-tooltip="true">
						<template slot-scope="scope">
							<div v-if="scope.row.eventType=='G'">{{ scope.row.eventName }}</div>
							<a v-if="scope.row.eventType=='F'" style="text-decoration:underline;color:#636CE4 " href="javascipt:void(0);" @click="viewDataFn(scope.row)">{{
								scope.row.eventName }}</a>
						</template>
					</yu-xtable-column>
					<yu-xtable-column label="事件路径" prop="folderPath" :show-overflow-tooltip="true"></yu-xtable-column>
					<yu-xtable-column label="周期节点" prop="cycleTime"></yu-xtable-column>
					<yu-xtable-column label="事件类型" prop="eventType" :options="eventTypeOption"></yu-xtable-column>
					<yu-xtable-column label="事件记录时间" width="150px" prop="recordTimeStr" :show-overflow-tooltip="true"></yu-xtable-column>
					<yu-xtable-column label="状态" prop="recordTime" :formatter="stateFormatter"></yu-xtable-column>
					<yu-xtable-column label="操作" width="140px">
						<template slot-scope="scope">
							<yu-button @click="recordEvent(scope.row,'flow')" type="text" size="small" v-if="scope.row.eventType=='G' && scope.row.recordTime==null">记录事件</yu-button>
							<yu-button @click="deleteEvent(scope.row,'flow')" type="text" size="small" v-if="scope.row.recordTime!=null" style="margin-left: 0px">清除事件</yu-button>
						</template>
					</yu-xtable-column>
				</yu-xtable>
			</yu-tab-pane>

		</yu-tabs>
	</yu-panel>
	<yu-xdialog title="文件列表" :visible.sync="dialogVisible" width="800px">
		<yu-xtable :pageable="false" :data="eventFiles" style="width: 100%" row-number max-height="350">
			<yu-xtable-column prop="cycleTime" label="文件ID">
			</yu-xtable-column>
			<yu-xtable-column prop="pathName" label="文件名称">
			</yu-xtable-column>
			<yu-xtable-column prop="recordStatus" label="记录状态">
			</yu-xtable-column>
			<yu-xtable-column prop="recordTimeStr" label="记录时间">
			</yu-xtable-column>
			<yu-xtable-column label="操作">
				<template slot-scope="scope">
					<yu-button @click="markFile(scope.row)" type="info" size="small" v-show="scope.row.recordTime==null">标记</yu-button>
					<yu-button @click="clearnMarkFile(scope.row)" type="info" size="small" v-show="scope.row.recordTime!=null">清除</yu-button>
				</template>
			</yu-xtable-column>
		</yu-xtable>
		<div class="yu-grpButton">
			<yu-button @click="cancelFn">关闭</yu-button>
		</div>
	</yu-xdialog>
</div>
<style type="text/css">
	.intervalSelectionClass {
		width: 100px;
		height: 20px;
		float: right;
	}
</style>